#ifndef  __Subject__
#define   __Subject__

#include "List.h"
#include "Observer.h"

typedef struct SubjectTag{
	Object super;
	List observers;
	void (*subjectAddObserver)(SubjectTag* self, Observer* observer);
	void (*subjectNotifyObservers)(SubjectTag* self);
} Subject;


void SubjectConstruct(Subject* self) {
	ObjectConstruct((Object*)self);
	ListConstruct((List*)(&(self->observers)), 0);
}

void SubjectDestruct(Subject* self) {
	ListDestruct((List*)(&(self->observers)));
	ObjectDestruct((Object*)self);
}

#endif